import fetch from './util/fetch';

//获取商品一级分类
// /goods/category
export function getFirCategory() {
    return fetch({
        url: '/goods/category',
        method: 'get'
    });
}

//二级
export function getSecCategory(categoryId) {
    return fetch({
        url: 'goods/type/listByCategoryId/' + categoryId,
        method: 'get'
    });
}

//品牌
export function getBrand(id) {
    return fetch({
        url: 'goods/brand/listByTypeId/' + id,
        method: 'get'
    });
}

//型号
export function getModel(data) {
    return fetch({
        url: 'goods/model/listByTypeIdAndBrandId',
        method: 'get',
        params:data
    });
}

//获取级联列表
export function getCategoryTree() {
    return fetch({
        url: '/goods/category/allCategory',
        method:'get'
    })
}
